#------------------------------------------------------------------------------------------------------------------------------ 
 if($args.count -lt 1) {throw("Parameter FIM server is missing!")}
 $uri = "http://" + $args[0] + ":5725/resourcemanagementservice"  
#------------------------------------------------------------------------------------------------------------------------------ 
 "" | clip
 $curFolder = Split-Path -Parent $MyInvocation.MyCommand.Path | Split-Path
 $fileName = "$curFolder\Data\Data.xml"
#------------------------------------------------------------------------------------------------------------------------------ 
 if(@(get-pssnapin | where-object {$_.Name -eq "FIMAutomation"} ).count -eq 0) {add-pssnapin FIMAutomation}
#------------------------------------------------------------------------------------------------------------------------------ 
 $data = export-fimconfig -uri $uri `
                          -customconfig ("/ma-data", "/mv-data", "/SynchronizationRule", "/WorkflowDefinition", "/ManagementPolicyRule", "/Set") `
						  -onlyBaseResources 
 $data | convertfrom-fimresource -file $fileName
#---------------------------------------------------------------------------------------------------------------------------------------------------------
 trap 
 { 
    $_.Exception.Message
    Exit 1
 }
#---------------------------------------------------------------------------------------------------------------------------------------------------------

 
 
 